package com.platform.qujia.service.impl;

import com.platform.qujia.dao.IntegralOrderMapper;
import com.platform.qujia.pojo.IntegralOrder;
import com.platform.qujia.pojo.vo.IntegralOrderVo;
import com.platform.qujia.service.IntegralOrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("integralOrderService")
public class IntegralOrderServiceImpl implements IntegralOrderService {
    @Resource
    private IntegralOrderMapper integralOrderMapper;

    //更新订单
    @Override
    public void updateIntegralOrder(IntegralOrder integralOrder) {
        integralOrderMapper.updateIntegralOrder(integralOrder);
    }

    @Override
    public IntegralOrderVo getIntegralOrderByOrderId(IntegralOrder integralOrder) {
       return integralOrderMapper.getIntegralOrderByOrderId(integralOrder);

    }

    //新增积分订单
    @Override
    public boolean insertIntegralOrder(IntegralOrder integralOrder) {
        boolean boo = false;
        int i = integralOrderMapper.insertIntegralOrder(integralOrder);
        if(i == 1){
            boo = true;
        }
        return boo;
    }

    //查询个人积分订单信息
    @Override
    public List<IntegralOrderVo> getUserIntegralOrderList(IntegralOrder integralOrder) {
        return integralOrderMapper.getUserIntegralOrderList(integralOrder);
    }
}
